#ifndef CONTROL_H
#define CONTROL_H

#include <QWidget>

#include <QSerialPort>//串口类
#include <QSerialPortInfo>//串口信息类
#include <QTcpSocket>
#include <QHostAddress>
#include "gpio.h"
#include "rtc.h"
#include "adc.h"
#include "timpwm.h"
#include "can.h"
#include "ap3216.h"
#include "sd_flash.h"



namespace Ui {
class control;
}

class control : public QWidget
{
    Q_OBJECT

public:
    explicit control(QWidget *parent = nullptr);
    ~control();
    //SerialPort *serial;
     rtc *time;
     gpio *gpiox;
     adc *adcx;
     TIMPWM *timpwmx;
     can *canx;
     ap3216 *ap3216c;

     sd_flash *sdflash;
     void delay(int msec);

signals:
   void tim_change();
   void adc_change();
   void count_change();

   void can_change();
   void ap3216c_change();
   void rng_change();
   void sdflash_change();

private slots:

    void receivemessage();
    void stateChanged(QAbstractSocket::SocketState);
    void read_data();

    void rng_play();


    void on_pushButton_clicked(bool checked);

    void on_pushButton_5_clicked(void);

    void on_pushButton_4_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_7_clicked();

    void on_pushButton_8_clicked();

    void on_pushButton_2_clicked(bool checked);

    void on_pushButton_9_clicked();


    void on_pushButton_10_clicked();

    void on_FLASH_SELECT_clicked();

    void on_pushButton_13_clicked();

    void on_pushButton_14_clicked();

private:
    Ui::control *ui;
 //   Ui::rtc *time_ui;
};

#endif // CONTROL_H
